const redis = require('redis')

module.exports = function (app) {
  const conf = app.get('redis') || {port: 6379, host: '127.0.0.1', db: 0}
  global.Aredis = redis.createClient(conf.port, conf.host, {
    db: conf.db,
    connect_timeout: '10000'
  })

  app.set('redisClient', redis)
}
